<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <style>
    #div1 {
        width: 200px;
        height: 200px;
        background: yellow;
        position: absolute;
    }
    
    #div2 {
        width: 200px;
        height: 200px;
        background: green;
        position: absolute;
    }
    </style>
    <script src="Drag.js"></script>
    <script src="LimitDrag.js"></script>
    <script>
    window.onload = function() {
        new Drag('div1');

        new LimitDrag('div2');

    };
    </script>
</head>

<body>
    <div id="div1">普通拖拽</div>
    <div id="div2">限制范围</div>
</body>

</html>
